using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class MultiplyManager : MonoBehaviour
{
    public GameObject ball, text;
    public TextMesh multiplyNumText;
    public int multiplyNum;

    private void Start()
    {
        multiplyNumText.text = string.Format("{0}{1}", "X", multiplyNum.ToString());
    }

    private void OnTriggerEnter(Collider other)
    {
        Tweener tweener = text.transform.DOPunchScale(new Vector3(0, 5, 0), 0.5f, 1, 0);
        Vector3 createTrans = other.transform.position;
        createTrans.y -= 0.3f;
        for (int i = 0; i < multiplyNum; i++)
        {
            Instantiate(ball, createTrans, other.transform.rotation);
        }
    }
}
